﻿<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <!--框架必需start-->
    <script src="scripts/jquery/jquery-1.10.2.min.js"></script>
    <link href="styles/font-awesome.min.css" rel="stylesheet" />
    <link href="scripts/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet" />
    <script src="scripts/plugins/jquery-ui/jquery-ui.min.js"></script>
    <!--框架必需end-->
    <!--bootstrap组件start-->
    <link href="scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="scripts/bootstrap/css/bootstrap.extension.css" rel="stylesheet" />
    <script src="scripts/bootstrap/js/bootstrap.min.js"></script>
    <!--bootstrap组件end-->
    <script src="scripts/plugins/datepicker/WdatePicker.js"></script>
    <script src="scripts/layui/layui.js"></script>
    <link href="scripts/plugins/tree/tree.css" rel="stylesheet" />
    <link href="scripts/plugins/datetime/pikaday.css" rel="stylesheet" />
    <link href="scripts/plugins/wizard/wizard.css" rel="stylesheet" />
    <link href="styles/ui.css" rel="stylesheet" />
    <script src="scripts/plugins/tree/tree.js"></script>
    <script src="scripts/plugins/validator/validator.js"></script>
    <script src="scripts/plugins/wizard/wizard.js"></script>
    <script src="scripts/plugins/datepicker/datepicker.js"></script>
    <script src="scripts/utils/applayout.js"></script>
    <script src="scripts/utils/flowlayout.js"></script>
    <script src="scripts/utils/form.js"></script>
    <script src="scripts/utils/ui.js"></script>
    <script src="scripts/utils/applayout.js"></script>
    <script src="scripts/plugins/flow-ui/flow.js"></script>
    <script src="scripts/utils/flowlayout.js"></script>
    <script src="scripts/utils/form.js"></script>
    <script src="Scripts/utils/ui.js"></script>
    <link href="scripts/plugins/simditor/css/simditor.css" rel="stylesheet" />
    <link href="scripts/plugins/cxColor/css/jquery.cxcolor.css" rel="stylesheet" />
    <link href="scripts/plugins/uploadify/uploadify.css" rel="stylesheet" />
    <link href="scripts/plugins/uploadify/uploadify.extension.css" rel="stylesheet" />
    <link href="scripts/plugins/flow-ui/flow.css" rel="stylesheet" />
    <link href="Styles/flow.css" rel="stylesheet" />
    <script src="scripts/plugins/simditor/js/module.min.js"></script>
    <script src="scripts/plugins/simditor/js/uploader.min.js"></script>
    <script src="scripts/plugins/simditor/js/hotkeys.min.js"></script>
    <script src="scripts/plugins/simditor/js/simditor.min.js"></script>
    <script src="scripts/plugins/cxColor/js/jquery.cxcolor.js"></script>
    <script src="scripts/plugins/uploadify/jquery.uploadify.min.js"></script>
    <link href="styles/ckbox-radio.css" rel="stylesheet" />
    <link href="styles/flow.css" rel="stylesheet" />
    <style>
        .standtab-pane
        {
            width: 224px;
            border-right: 1px solid #ccc;
            float: left;
        }
    </style>
    <script>
        var frmtype, lineobject, fromnode, frmCotent, nodePramData, Flow_Bill;
        $(function () {
            //            AnysHandler();
            initLoadPageData();
            initControl();
            //            initControl();
        })
        //初始化数据
        function initLoadPageData() {
            var _FlowDesignObject = parent.FlowDesignObject;
            lineobject = _FlowDesignObject.$lineData[parent.LineId];
            lineobject.id = parent.LineId;
        }
        //初始化控件
        function initControl() {
            //字段1selField
            var selectValue;
            $.ajax({
                url: "/SystemManage/Flow/bdlxBindField?strid=" + parent.Flow_Bill,
                type: 'POST',
                dataType: "json",
                success: function (data) {
                    var zp_zzmm = document.getElementById("selField");
                    for (var idx in data)
                    {
                        var option = document.createElement("option");
                        if (data[idx].id == selectValue)
                            option.selected = true;
                        option.value = data[idx].id;
                        option.innerHTML = data[idx].text;

                        zp_zzmm.appendChild(option);
                    }

                    var zp_zzmm1 = document.getElementById("selField1");
                    for (var idx in data) {
                        var option = document.createElement("option");
                        if (data[idx].id == selectValue)
                            option.selected = true;
                        option.value = data[idx].id;
                        option.innerHTML = data[idx].text;
                        zp_zzmm1.appendChild(option);
                    }
                }
            });


            //条件1
            $("#selEqual").ComboBox({
                data: [{ "key": 0, "value": "请选择" },
                        { "key": 1, "value": "大于" },
                        { "key": 2, "value": "大于等于" },
                        { "key": 3, "value": "小于" },
                        { "key": 4, "value": "小于等于" },
                        { "key": 5, "value": "等于" },
                        { "key": 6, "value": "不等于" },
                        { "key": 7, "value": "字符开头" },
                        { "key": 8, "value": "字符结尾" }],
                id: "key",
                text: "value"
            }).ComboBoxSetValue(0);

            //关联条件
            $("#selAndOr").ComboBox({
                data: [{ "key": 0, "value": "请选择" },
                        { "key": 1, "value": "并且" },
                        { "key": 2, "value": "或者"}],
                id: "key",
                text: "value"
            }).bind("change", function () {
                var _value = $(this).attr('data-value');
                if (_value != "0") {
                    $("#selEqual1").removeAttr("disabled");
                    $("#txtValue1").removeAttr("disabled");
                    $("#selField1").removeAttr("disabled");
                } else {
                    $("#selEqual1").attr("disabled", true);
                    $("#txtValue1").attr("disabled", true);
                    $("#selField1").attr("disabled", true);
                }
            }).ComboBoxSetValue(0);

            //条件2
            $("#selEqual1").ComboBox({
                data: [{ "key": 0, "value": "请选择" },
                        { "key": 1, "value": "大于" },
                        { "key": 2, "value": "大于等于" },
                        { "key": 3, "value": "小于" },
                        { "key": 4, "value": "小于等于" },
                        { "key": 5, "value": "等于" },
                        { "key": 6, "value": "不等于" },
                        { "key": 7, "value": "字符开头" },
                        { "key": 8, "value": "字符结尾" }],
                id: "key",
                text: "value"
            }).ComboBoxSetValue(0);
            $("#selEqual1").attr("disabled", true);
            $("#txtValue1").attr("disabled", true);
            $("#selField1").attr("disabled", true);

            setTimeout("funSetA()", "2000");
        }

        function funSetA() {

            if (lineobject.setInfo != undefined) {
                $("#selEqual").ComboBoxSetValue(lineobject.setInfo["selEqual"]);
                $("#selAndOr").ComboBoxSetValue(lineobject.setInfo["selAndOr"]);
                $("#selAndOr").trigger('change');
                $("#selEqual1").ComboBoxSetValue(lineobject.setInfo["selEqual1"]);

                $("#txtValue").val(lineobject.setInfo["txtValue"]);
                $("#txtValue1").val(lineobject.setInfo["txtValue1"]);
                $("#selField").val(lineobject.setInfo["selField"]);
                $("#selField1").val(lineobject.setInfo["selField1"]);
            }
        }

        function AcceptClick() {
            var postData = {
                "selEqual": $("#selEqual").attr('data-value'),
                "txtValue": $("#txtValue").val(),
                "selField": $("#selField").val(),
                "selAndOr": $("#selAndOr").attr('data-value'),
                "selEqual1": $("#selEqual1").attr('data-value'),
                "txtValue1": $("#txtValue1").val(),
                "selField1": $("#selField1").val()
            };
            parent.callBackLine(lineobject.id, postData);
            //            parent.callBackNode("", '444', "");
            //            NodePramData="";
            //            parent.callBackNode(node.id, '444', NodePramData);
        }

        function check(v) {
            //var i = v.value;
            //if (isNaN(i)) {
            //    v.value = v.value.substring(0, v.value.length - 1);
            //}
        }
    </script>
</head>
<body>
    <div style="padding: 10px 0px 0px 10px;">
        <table style="font-size: 9pt; line-height: 30px;">
            <tr>
                <td style="text-align: left;">
                    条件：
                </td>
                <td style="text-align: left; width: 110px;">
                    <select id="selField" name="selField" class="form-control"></select>
                </td>
                <td style="text-align: left; width: 110px;">
                    <div id="selEqual" type="select" class="ui-select" style="width: 100px;">
                    </div>
                </td>
                <td style="text-align: left;">
                    <input id="txtValue" type="text" class="form-control" onkeyup="check(this);" />
                </td>
            </tr>
            <tr>
                <td style="text-align: left;">
                    &nbsp;
                </td>
                <td colspan="3" style="text-align: left;">
                    <div id="selAndOr" type="select" class="ui-select" style="width: 100px;">
                    </div>
                </td>
            </tr>
            <tr>
                <td style="text-align: left;">
                    条件：
                </td>
                <td style="text-align: left; width: 110px;">
                    <select id="selField1" name="selField1" class="form-control"></select>
                </td>
                <td style="text-align: left;">
                    <div id="selEqual1" type="select" class="ui-select" style="width: 100px;">
                    </div>
                </td>
                <td style="text-align: left;">
                    <input id="txtValue1" type="text" class="form-control" onkeyup="check(this);" onfocus="this.select();" onblur="if(this.value=='')this.value=0;"
                           value="0" />
                </td>
            </tr>
        </table>
    </div>
</body>
</html>
